]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Disconnect signals on destroy
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 8 Jul 2021 18:36:14 +0000 (20:36 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 8 Jul 2021 23:17:01 +0000 (23:17 +0000)
Otherwise the handler will trip over unset properties on an object
that is being disposed. Avoid the resulting log spam by disconnecting
the handler in question.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1909>

js/ui/iconGrid.js

index cdceb020df2e032f2c97618a326683f48b1014eb..efc638913e431a4951e19484e3cba0a4a05f00b4 100644 (file)
@@ -1172,7 +1172,8 @@ var IconGrid = GObject.registerClass({
             row_spacing: 0,
         });
         const layoutManager = new IconGridLayout(layoutParams);
-        layoutManager.connect('pages-changed', () => this.emit('pages-changed'));
+        const pagesChangedId = layoutManager.connect('pages-changed',
+            () => this.emit('pages-changed'));
 
         super._init({
             style_class: 'icon-grid',
@@ -1188,6 +1189,7 @@ var IconGrid = GObject.registerClass({
 
         this.connect('actor-added', this._childAdded.bind(this));
         this.connect('actor-removed', this._childRemoved.bind(this));
+        this.connect('destroy', () => layoutManager.disconnect(pagesChangedId));
     }
 
     _getChildrenToAnimate() {